package influence.propagation.implementation;

import java.util.HashMap;
import java.util.List;
import java.util.Map;
import influence.propagation.core.NodeModel;
import influence.propagation.core.ResultSet;

public class ConcreteResultSet implements ResultSet {
	
	private Map<Integer, List<NodeModel>> resultSet = new HashMap<Integer, List<NodeModel>>();
	
	protected ConcreteResultSet(Map<Integer, List<NodeModel>> r) {
		resultSet=r;
	}

	@Override
	public int getIterations() {
		return resultSet.keySet().size();
	}

	@Override
	public int getOccurence(int iteration) {
		return resultSet.get(new Integer(iteration)).size();
	}

	@Override
	public NodeModel get(int iteration, int occurence) {
		return resultSet.get(new Integer(iteration)).get(occurence);
	}

	@Override
	public String toString() {
		return "ConcreteResultSet [resultSet=" + resultSet + "]";
	}
}
